<%@page import="org.apache.commons.lang.StringUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%
	String basePath = request.getContextPath();
	String errorMsg = (String)request.getAttribute("errorMsg");
%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>车辆信息新增</title>
<script type="text/javascript" src="<%=basePath%>/resources/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/resources/js/commonUtil.js"></script>
<script type="text/javascript" src="<%=basePath%>/resources/js/validateUtil.js"></script>
<link rel="stylesheet" href="<%=basePath%>/resources/css/main.css">
<script type="text/javascript">
$(function(){
	$("#submitBtn").click(function(){
		if (!checkForm()) {
			return false;
		}
		//Form表单提交
		//document.getElementById("addForm").submit();
		$("#addForm").submit();
	});
	
});

function checkForm() {
	var realName = $("#realName").val();
	if (realName == null || realName == '') {
		alert("请填写真是姓名!");
		return false;
	}
	var nickName = $("#nickName").val();
	if (nickName == null || nickName == '') {
		alert("请填写用户昵称!");
		return false;
	}
	var password = $("#password").val();
	if (password == null || password == '') {
		alert("请填写用户密码!");
		return false;
	}
	var popedom = $("#popedom").val();
	if (popedom == null || popedom == '') {
		alert("请填写身份标志!");
		return false;
	}
	var sex = $("#sex").val();
	if (sex == null || sex == '') {
		alert("请填写选择性别!");
		return false;
	}
	var age = $("#age").val();
	if (age == null || age == '') {
		alert("请填写输入真是年龄!");
		return false;
	}
	var mobilePhone = $("#mobilePhone").val();
	if (mobilePhone == null || mobilePhone == '') {
		alert("请填写输入手机号码!");
		return false;
	}
	
	return true;
}
</script>
</head>
<body>
	<div align="center">
		<% if (StringUtils.isNotEmpty(errorMsg)) { %>
		<div class="error">
			${errorMsg }
		</div>
		<% } %>
		<form action="<%=basePath %>/employee/add" method="post" id="addForm" name="addForm">
			<input type="hidden" name="employeeId" id="employeeId" value="employeeId">
			<table class="listTab">
				<tr>
					<th align="right">Real Name：</th>
					<td>
						<input id="realName" name="realName" type="text" value="${employee.realName }"/>
					</td>
				</tr>
				<tr>
					<th align="right">Nice Name：</th>
					<td>
						<input id="nickName" name="nickName" type="text" value="${employee.nickName }"/>
					</td>
				</tr>
				<tr>
					<th align="right">password：</th>
					<td>
						<input id="password" name="password" type="password" value="${employee.password }"/>
					</td>
				</tr>
				<tr>
					<th align="right">popedom：</th>
					<td>
						<input id="popedom" name="popedom" type="text" value="${employee.popedom }"/>
					</td>
				</tr>
				<tr>
					<th align="right">sex：</th>
					<td>
						<input id=sex name="sex" type="text" value="${employee.sex }"/>
					</td>
				</tr>
				<tr>
					<th align="right">age：</th>
					<td>
						<input id="age" name="age" type="text" value="${employee.age }"/>
					</td>
				</tr>
				<tr>
					<th align="right">mobilePhone：</th>
					<td>
						<input id="mobilePhone" name="mobilePhone" type="text" value="${employee.mobilePhone }"/>
					</td>
				</tr>
				<tr>
					<th align="right">email：</th>
					<td>
						<input id="email" name="email" type="text" value="${employee.email }"/>
					</td>
				</tr>
				<tr>
					<th align="right">weixin：</th>
					<td>
						<input id="weixin" name="weixin" type="text" value="${employee.weixin }"/>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<div>
							<input type="submit" name="argsubmit" style="display:none"/>
							<a id="backBtn" class="button submitBtn" href="/vims/employee/findAll">返  回</a>
							<a id="submitBtn" class="button submitBtn" href="javascript:void();">提  交</a>
						</div>
					</td>
				</tr>
			</table>
	    </form>
    </div>
</body>
</html>